﻿<UserControl x:Class="StockAnalyst2.Plugins.Visualization.Historical.ResultViewer"
			 x:ClassModifier="internal"
			 
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
			 xmlns:x2="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
			 mc:Ignorable="d" 
			 
             xmlns:Converters="clr-namespace:Utils.Wpf.Converters;assembly=Utils"
             xmlns:Historical="clr-namespace:StockAnalyst2.Plugins.Visualization.Historical"
             xmlns:System="clr-namespace:System;assembly=mscorlib" Background="#1F1F1F" 
			 
			 d:DataContext="{d:DesignInstance Type=Historical:ResultViewerVM}" 
			 d:DesignWidth="1500" >

	<UserControl.Resources>
		<ResourceDictionary>
			<Converters:MultiplierConverter x:Key="MultiplierConverter" />
			<ResourceDictionary.MergedDictionaries>
				<ResourceDictionary Source="..\..\..\StockAnalystTheme.xaml" />
			</ResourceDictionary.MergedDictionaries>
		</ResourceDictionary>
	</UserControl.Resources>

	<!--<UserControl.Background>
		<StaticResource ResourceKey="GridBackground" />
	</UserControl.Background>-->

	<Grid>
		<Grid.RowDefinitions>
			<RowDefinition Height="Auto" />
			<RowDefinition Height="*" />
		</Grid.RowDefinitions>
		<Grid.ColumnDefinitions>
			<ColumnDefinition Width="*" />
		</Grid.ColumnDefinitions>

		<Border Grid.Row="0" BorderThickness="0" Background="{StaticResource WindowBackground}" >
			<TextBlock Text="Execution Results" HorizontalAlignment="Center" Margin="10" FontSize="{Binding FontSize, RelativeSource={RelativeSource AncestorType=UserControl}, Converter={StaticResource MultiplierConverter}, ConverterParameter=1.5}" />
		</Border>

		<ScrollViewer Grid.Row="1">
			<Grid>
				<Grid.RowDefinitions>
					<RowDefinition Height="Auto" />
					<RowDefinition Height="{Binding ActualHeight, ElementName=SummaryRow, Converter={StaticResource MultiplierConverter}, ConverterParameter=2}" />
					<RowDefinition Height="Auto" />
					<RowDefinition Height="Auto" />
				</Grid.RowDefinitions>
				<Grid.ColumnDefinitions>
					<ColumnDefinition Width="*" />
				</Grid.ColumnDefinitions>
				
				<!-- Summary Viewer -->
				<Historical:SummaryViewer Grid.Row="0" Margin="10,0,10,10" DataContext="{Binding SummaryViewerVM}" x:Name="SummaryRow" />

				<!-- Result Chart -->
				<Historical:ResultChart Grid.Row="1" Margin="10" DataContext="{Binding ResultChartVM}" />

				<!-- Detail Viewer -->
				<Historical:DetailViewer Grid.Row="2" Margin="10" DataContext="{Binding DetailViewerVM}" />

				<!-- Picture Viewer -->
				<Historical:CustomDataViewer Grid.Row="3" Margin="10" DataContext="{Binding CustomDataViewerVM}" />

			</Grid>
		</ScrollViewer>
	</Grid>
</UserControl>
